<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8"/>
    <meta name="renderer" content="webkit|ie-comp|ie-stand"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <!--[if lt IE 9]>
    <script type="text/javascript" src="lib/html5shiv.js"></script>
    <script type="text/javascript" src="lib/respond.min.js"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="/lib/layui-v2.2.5/css/layui.css"/>
    <link rel="stylesheet" type="text/css" href="/h-ui/css/H-ui.min.css"/>
    <link rel="stylesheet" type="text/css" href="/h-ui.admin/css/H-ui.admin.css"/>
    <link rel="stylesheet" type="text/css" href="/lib/Hui-iconfont/1.0.8/iconfont.css"/>
    <link rel="stylesheet" type="text/css" href="/h-ui.admin/skin/default/skin.css" id="skin"/>
    <link rel="stylesheet" type="text/css" href="/h-ui.admin/css/style.css"/>
    <!--[if IE 6]>
    <script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <title>新增接口</title>
    <script>
        var _hmt = _hmt || [];
        (function () {
            var hm = document.createElement("script");
            hm.src = "https://hm.baidu.com/hm.js?66eb41787f05b9755f31623b0d2a8d6e";
            var s = document.getElementsByTagName("script")[0];
            s.parentNode.insertBefore(hm, s);
        })();
    </script>
</head>
<body>
<div class="page-container">
    <form class="form form-horizontal" id="form-article-add">
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>接口名称：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" value="" placeholder="" id="api_name" name=""/>
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>接口地址：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" value="" placeholder="" id="api_url" name=""/>
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>所属项目：</label>
            <div class="formControls col-xs-4 col-sm-4">
				<span class="select-box">
				<select id="selSubject" class="select">
				</select>
				</span>
            </div>
            <div class="formControls col-xs-4 col-sm-5">
                <button class="btn btn-primary radius" type="button" onclick="addSubject();">新增项目</button>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">所属分类：</label>
            <div class="formControls col-xs-4 col-sm-4">
				<span class="select-box">
				<select id="selType" class="select">
				</select>
				</span>
            </div>
            <div class="formControls col-xs-4 col-sm-5">
                <button class="btn btn-primary radius" type="button" onclick="addType();">新增分类</button>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">请求类型：</label>
            <div class="formControls col-xs-4 col-sm-4">
				<span class="select-box">
				<select class="select" id="requestType">
					<option value="POST/GET">POST/GET</option>
					<option value="POST">POST</option>
					<option value="GET">GET</option>
				</select>
				</span>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">请求参数:</label>
            <div class="formControls col-xs-8 col-sm-9">
                <button class="btn btn-primary radius" type="button" onclick="addParams();">新增</button>
                <table class="layui-table" id="paramsTable">
                    <colgroup>
                        <col width="150"/>
                        <col width="150"/>
                        <col width="150"/>
                        <col/>
                        <col width="80"/>
                    </colgroup>
                    <thead>
                    <tr>
                        <th>参数</th>
                        <th>是否必填</th>
                        <th>类型</th>
                        <th>说明</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr>
                        <td><input type="text" class="input-text" value="user_token" placeholder="" id="" name=""/></td>
                        <td>
				      	<span class="select-box">
						<select name="" class="select">
							<option value="是">是</option>
							<option value="否">否</option>
						</select>
						</span>
                        </td>
                        <td>
				      	<span class="select-box">
						<select name="" class="select">
							<option value="header">header</option>
							<option value="param">param</option>
						</select>
						</span>
                        </td>
                        <td><input type="text" class="input-text" value="令牌" placeholder="" id="" name=""/></td>
                        <td>
                            <a style="text-decoration:none" class="ml-5" onClick="api_del(this,'10001')"
                               href="javascript:;" title="删除"><i class="Hui-iconfont">&#xe6e2;</i></a>
                        </td>
                    </tr>

                    <tr>
                        <td><input type="text" class="input-text" value="push_userid" placeholder="" id="" name=""/>
                        </td>
                        <td>
				      	<span class="select-box">
						<select name="" class="select">
							<option value="是">是</option>
							<option value="否">否</option>
						</select>
						</span>
                        </td>
                        <td>
				      	<span class="select-box">
						<select name="" class="select">
							<option value="header">header</option>
							<option value="param">param</option>
						</select>
						</span>
                        </td>
                        <td><input type="text" class="input-text" value="消息推送UserID，百度SDK提供，h5转递0" placeholder="" id=""
                                   name=""/></td>
                        <td>
                            <a style="text-decoration:none" class="ml-5" onClick="api_del(this,'10001')"
                               href="javascript:;" title="删除"><i class="Hui-iconfont">&#xe6e2;</i></a>
                        </td>
                    </tr>

                    <tr>
                        <td><input type="text" class="input-text" value="app_device" placeholder="" id="" name=""/></td>
                        <td>
				      	<span class="select-box">
						<select name="" class="select">
							<option value="是">是</option>
							<option value="否">否</option>
						</select>
						</span>
                        </td>
                        <td>
				      	<span class="select-box">
						<select name="" class="select">
							<option value="header">header</option>
							<option value="param">param</option>
						</select>
						</span>
                        </td>
                        <td><input type="text" class="input-text" value="请求设备类型 0为PC 1为移动H5 2为微信 3为安卓 4为IOS 5小程序"
                                   placeholder="" id="" name=""/></td>
                        <td>
                            <a style="text-decoration:none" class="ml-5" onClick="api_del(this,'10001')"
                               href="javascript:;" title="删除"><i class="Hui-iconfont">&#xe6e2;</i></a>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">返回结果:</label>
            <div class="formControls col-xs-8 col-sm-9">
                <textarea id="apiResult" required lay-verify="required" rows="20" placeholder="请输入返回结果"
                          class="layui-textarea"></textarea>
            </div>
        </div>

        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
                <button onClick="api_save();" class="btn btn-primary radius" type="button"><i class="Hui-iconfont">&#xe632;</i>
                    保存
                </button>

                <button onClick="layer_close();" class="btn btn-default radius" type="button">
                    &nbsp;&nbsp;取消&nbsp;&nbsp;
                </button>
            </div>
        </div>
    </form>
</div>


<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="/h-ui.admin/js/H-ui.admin.js"></script>
<!--/_footer /作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="/lib/jquery.validation/1.14.0/jquery.validate.js"></script>
<script type="text/javascript" src="/lib/jquery.validation/1.14.0/validate-methods.js"></script>
<script type="text/javascript" src="/lib/jquery.validation/1.14.0/messages_zh.js"></script>
<script type="text/javascript" src="/js/api-add.js"></script>
</body>
</html>